<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .box{
            width: 200px;
            height: 200px;
            margin: 100px auto;
            background-color: rgb(241, 62, 18);
        }
        p{
            font-size: 18px;
            transition: 0.5s linear;
        }
    </style>
</head>
<body>
    <div class="box">
        <p>你好</p>
    </div>
    <script>
        
       
        var box=document.querySelector(".box");
        var p=document.querySelector("p");
        var count=0;
        const maxCount=5;
        box.addEventListener("click",function(event){
            count++;
            alert("你点击"+count+"次,还剩下"+(maxCount-count)+"次数,请注意!")
            if (count==maxCount) {
                alert("次数用完 结束了!")
                box.removeEventListener(event.type,arguments.callee,false);
            }
        },false);


        

        
    </script>
</body>
</html>